
<% form_tag({ :controller => 'search', :action => 'advanced_search'}, {:style => "font-size:80%; display:block; float:right"} ) do %>
  <label for="special_fields"><%= 'New page with different number of search term fields:'.t %></label>
  <%= select('special', 'fields', @opts_for_fields) %>
  <% if params[:folder_id] %><input id="special_folder_id" name="folder_id" value="<%= params[:folder_id] %>" type="hidden" /><% end %>
  <%= submit_tag 'Show'.t, { :class => 'searchBtn' } %>
<% end %>

<p class="title"><%= 'Advanced Search'.t %></p>

<% form_tag({ :controller => 'search', :action => 'show_results' }) do %>
    <label for="search_query"><%= 'Search terms (optional if other terms are specified below):'.t %></label><br />
    <%= text_area'search', 'query', { :value => @search_query, :rows => '3', :cols => '80' } %>
    <br />

    <label for="special"><%= 'Other terms to search for (put one for each line):'.t %></label><br />
    <% @special_fields.times do |field_number| %>
      <select name="special[<%= field_number %>][type]" id="special_<%= field_number %>_type" onchange="hidefield(this,<%= field_number %>)">
        <%= options_for_select(@opts_for_type) %>
      </select>
      <%= text_field 'special', 'term', { 'index' => field_number , :class => 'searchField', :size => nil } %><br />
      <script type="text/javascript"><!-- 
        hidefield(document.getElementById("special_<%= field_number %>_type"),<%= field_number %>)
      --></script>
    <% end %>
    <%= submit_tag 'Find!'.t, { :class => 'searchBtn' } %>
<% end %>